<%= form_for @product, :html => { :class => "form-horizontal product" } do |f| %>

    <% if @product.errors.any? %>
    <div id="error_expl" class="panel panel-danger">
      <div class="panel-heading">
        <h3 class="panel-title"><%= pluralize(@product.errors.count, "error") %> prohibited this product from being saved:</h3>
      </div>
      <div class="panel-body">
        <ul>
        <% @product.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
        </ul>
      </div>
    </div>
  <% end %>

  <div class="control-group">
    <%= f.label :name, :class => 'control-label' %>
    <div class="controls">
      <%= f.text_field :name, :class => 'form-control' %>
    </div>
    <%= error_span(@product[:name]) %>
  </div>
  <div class="control-group">
    <%= f.label :price, :class => 'control-label' %>
    <div class="controls">
      <%= f.text_field :price, :class => 'form-control' %>
    </div>
    <%= error_span(@product[:price]) %>
  </div>
  <div class="control-group">
    <%= f.label :description, :class => 'control-label' %>
    <div class="controls">
      <%= f.text_field :description, :class => 'form-control' %>
    </div>
    <%= error_span(@product[:description]) %>
  </div>


  <%= f.submit nil, :class => 'btn btn-primary' %>
  <%= link_to t('.cancel', :default => t("helpers.links.cancel")),
            products_path, :class => 'btn btn-default' %>

<% end %>
